package com.eddie.jdbc.web;

import com.alibaba.fastjson.TypeReference;
import com.eddie.jdbc.app.PetController;
import com.eddie.jdbc.app.PetStoreController;
import com.eddie.jdbc.vo.PetVo;
import com.eddie.jdbc.vo.R;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * @author Eddie
 * @date 2022/3/3 19:29
 */
public class MainWeb {

    private final PetStoreController storeController = new PetStoreController();
    private final PetController petStoreController = new PetController();

    public void indexMenu() {
        System.out.println("宠物商店启动");
        System.out.println("====================================");
        List<PetVo> petList = petStoreController.getPetList().getData(new TypeReference<>() {
        });
        System.out.print("序号" + "\t"
                + "名称" + "\t\t"
                + "类型" + "\t\t"
                + "品种" + "\t\t"
                + "价格" + "\t\t"
                + "状态" + "\t\t\t"
                + "生日" + "\t\t"
                + "库存宠物" + "\t"
                + "所属商店" + "\n");
        for (PetVo petVo : petList) {
            System.out.println(petVo);
        }
        System.out.println("====================================");

    }

}
